<!DOCTYPE html>
<html lang="en-US">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>Denzel - Columns —— CSS多栏布局</title>
    <meta name="description" content="前端笔记">
    <meta name="keywords" content="web前端,HTML5,CSS3,Javascript,SVG,canvas">
  <meta name="anthor" content="Denzel">
  <meta name="theme-color" content="#3eaf7c">
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-status-bar-style" content="black">
  <meta name="msapplication-TileImage" content="/icons/msapplication-icon-144x144.png">
  <meta name="msapplication-TileColor" content="#000000">
  <link rel="icon" href="/blog/vuepress/logo.png">
  <link rel="manifest" href="/blog/vuepress/manifest.json">
  <link rel="apple-touch-icon" href="/blog/vuepress/icons/apple-touch-icon-152x152.png">
  <link rel="mask-icon" href="/blog/vuepress/icons/safari-pinned-tab.svg" color="#3eaf7c">
    
    <link rel="preload" href="/blog/vuepress/assets/css/0.styles.d4f29607.css" as="style"><link rel="preload" href="/blog/vuepress/assets/js/app.15770e34.js" as="script"><link rel="preload" href="/blog/vuepress/assets/js/51.766a8294.js" as="script"><link rel="preload" href="/blog/vuepress/assets/js/80.4ca072f1.js" as="script"><link rel="prefetch" href="/blog/vuepress/assets/js/46.59c0ece7.js"><link rel="prefetch" href="/blog/vuepress/assets/js/1.05e4270f.js"><link rel="prefetch" href="/blog/vuepress/assets/js/2.ace739f7.js"><link rel="prefetch" href="/blog/vuepress/assets/js/3.636e5a79.js"><link rel="prefetch" href="/blog/vuepress/assets/js/4.7a55aa4b.js"><link rel="prefetch" href="/blog/vuepress/assets/js/5.b56b0573.js"><link rel="prefetch" href="/blog/vuepress/assets/js/6.e9a3fbc8.js"><link rel="prefetch" href="/blog/vuepress/assets/js/7.aa46c47d.js"><link rel="prefetch" href="/blog/vuepress/assets/js/8.a9288ac6.js"><link rel="prefetch" href="/blog/vuepress/assets/js/9.b9f8dec6.js"><link rel="prefetch" href="/blog/vuepress/assets/js/10.3e2ea470.js"><link rel="prefetch" href="/blog/vuepress/assets/js/11.4d115f98.js"><link rel="prefetch" href="/blog/vuepress/assets/js/12.c97cf4d0.js"><link rel="prefetch" href="/blog/vuepress/assets/js/13.1e0cf594.js"><link rel="prefetch" href="/blog/vuepress/assets/js/14.bab9026a.js"><link rel="prefetch" href="/blog/vuepress/assets/js/15.1a24cffe.js"><link rel="prefetch" href="/blog/vuepress/assets/js/16.e9995850.js"><link rel="prefetch" href="/blog/vuepress/assets/js/17.86a1f7d2.js"><link rel="prefetch" href="/blog/vuepress/assets/js/18.c32400c4.js"><link rel="prefetch" href="/blog/vuepress/assets/js/19.9f99887c.js"><link rel="prefetch" href="/blog/vuepress/assets/js/20.82f0c2f9.js"><link rel="prefetch" href="/blog/vuepress/assets/js/21.7f5c223d.js"><link rel="prefetch" href="/blog/vuepress/assets/js/22.acf9934c.js"><link rel="prefetch" href="/blog/vuepress/assets/js/23.20d8e817.js"><link rel="prefetch" href="/blog/vuepress/assets/js/24.acf27379.js"><link rel="prefetch" href="/blog/vuepress/assets/js/25.20165510.js"><link rel="prefetch" href="/blog/vuepress/assets/js/26.83a2ddc3.js"><link rel="prefetch" href="/blog/vuepress/assets/js/27.33276a04.js"><link rel="prefetch" href="/blog/vuepress/assets/js/28.e320efab.js"><link rel="prefetch" href="/blog/vuepress/assets/js/29.3fd92c30.js"><link rel="prefetch" href="/blog/vuepress/assets/js/30.2bc84d43.js"><link rel="prefetch" href="/blog/vuepress/assets/js/31.d70ed500.js"><link rel="prefetch" href="/blog/vuepress/assets/js/32.e7a0f8e1.js"><link rel="prefetch" href="/blog/vuepress/assets/js/33.c48ee70b.js"><link rel="prefetch" href="/blog/vuepress/assets/js/34.8ad03d1b.js"><link rel="prefetch" href="/blog/vuepress/assets/js/35.5bdb3994.js"><link rel="prefetch" href="/blog/vuepress/assets/js/36.a25f926e.js"><link rel="prefetch" href="/blog/vuepress/assets/js/37.7515cfbb.js"><link rel="prefetch" href="/blog/vuepress/assets/js/38.99347371.js"><link rel="prefetch" href="/blog/vuepress/assets/js/39.3481fc62.js"><link rel="prefetch" href="/blog/vuepress/assets/js/40.bc709734.js"><link rel="prefetch" href="/blog/vuepress/assets/js/41.e1e0a3bf.js"><link rel="prefetch" href="/blog/vuepress/assets/js/42.762b61b0.js"><link rel="prefetch" href="/blog/vuepress/assets/js/43.8f0b2d6c.js"><link rel="prefetch" href="/blog/vuepress/assets/js/44.2a0a4ee0.js"><link rel="prefetch" href="/blog/vuepress/assets/js/45.baf7ed60.js"><link rel="prefetch" href="/blog/vuepress/assets/js/47.11a8720a.js"><link rel="prefetch" href="/blog/vuepress/assets/js/48.e0bf8b54.js"><link rel="prefetch" href="/blog/vuepress/assets/js/49.c96c4011.js"><link rel="prefetch" href="/blog/vuepress/assets/js/50.31189263.js"><link rel="prefetch" href="/blog/vuepress/assets/js/52.26b971fd.js"><link rel="prefetch" href="/blog/vuepress/assets/js/53.0cfbd708.js"><link rel="prefetch" href="/blog/vuepress/assets/js/54.bdc15c87.js"><link rel="prefetch" href="/blog/vuepress/assets/js/55.fea285a9.js"><link rel="prefetch" href="/blog/vuepress/assets/js/56.e030a6b2.js"><link rel="prefetch" href="/blog/vuepress/assets/js/57.bd168a1e.js"><link rel="prefetch" href="/blog/vuepress/assets/js/58.636557fa.js"><link rel="prefetch" href="/blog/vuepress/assets/js/59.5d1d0ce6.js"><link rel="prefetch" href="/blog/vuepress/assets/js/60.0b779f92.js"><link rel="prefetch" href="/blog/vuepress/assets/js/61.4ec3f2eb.js"><link rel="prefetch" href="/blog/vuepress/assets/js/62.8f70f114.js"><link rel="prefetch" href="/blog/vuepress/assets/js/63.9ac2b61d.js"><link rel="prefetch" href="/blog/vuepress/assets/js/64.c028fad5.js"><link rel="prefetch" href="/blog/vuepress/assets/js/65.923a8d15.js"><link rel="prefetch" href="/blog/vuepress/assets/js/66.73db652e.js"><link rel="prefetch" href="/blog/vuepress/assets/js/67.1a91446d.js"><link rel="prefetch" href="/blog/vuepress/assets/js/68.e5a12a42.js"><link rel="prefetch" href="/blog/vuepress/assets/js/69.6ddcb882.js"><link rel="prefetch" href="/blog/vuepress/assets/js/70.ceb70d85.js"><link rel="prefetch" href="/blog/vuepress/assets/js/71.a804ef40.js"><link rel="prefetch" href="/blog/vuepress/assets/js/72.f1c4098c.js"><link rel="prefetch" href="/blog/vuepress/assets/js/73.2f28b842.js"><link rel="prefetch" href="/blog/vuepress/assets/js/74.571c2ab1.js"><link rel="prefetch" href="/blog/vuepress/assets/js/75.f365c2a1.js"><link rel="prefetch" href="/blog/vuepress/assets/js/76.0916a3cd.js"><link rel="prefetch" href="/blog/vuepress/assets/js/77.469aed17.js"><link rel="prefetch" href="/blog/vuepress/assets/js/78.02cdd59d.js"><link rel="prefetch" href="/blog/vuepress/assets/js/79.44d7f95c.js"><link rel="prefetch" href="/blog/vuepress/assets/js/81.d9239a49.js"><link rel="prefetch" href="/blog/vuepress/assets/js/82.b09096b2.js"><link rel="prefetch" href="/blog/vuepress/assets/js/83.f4bc8a9b.js"><link rel="prefetch" href="/blog/vuepress/assets/js/84.1ffe6969.js"><link rel="prefetch" href="/blog/vuepress/assets/js/85.44e980f9.js"><link rel="prefetch" href="/blog/vuepress/assets/js/86.c8579ac0.js"><link rel="prefetch" href="/blog/vuepress/assets/js/87.cd49f324.js"><link rel="prefetch" href="/blog/vuepress/assets/js/88.3851b6ff.js"><link rel="prefetch" href="/blog/vuepress/assets/js/89.b05297be.js"><link rel="prefetch" href="/blog/vuepress/assets/js/90.c1e3263e.js"><link rel="prefetch" href="/blog/vuepress/assets/js/91.b493a1bb.js"><link rel="prefetch" href="/blog/vuepress/assets/js/92.80ab06fd.js"><link rel="prefetch" href="/blog/vuepress/assets/js/93.c6ca00b3.js"><link rel="prefetch" href="/blog/vuepress/assets/js/94.e993d310.js"><link rel="prefetch" href="/blog/vuepress/assets/js/95.8e19a7ed.js">
    <link rel="stylesheet" href="/blog/vuepress/assets/css/0.styles.d4f29607.css">
  </head>
  <body>
    <div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div><a href="/blog/vuepress/" class="home-link router-link-active"><img src="/blog/vuepress/hero.png" class="logo"><span class="site-name can-hide">
      Denzel
    </span></a><div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""><!----></div><nav class="nav-links can-hide"><div class="nav-item"><a href="/blog/vuepress/js/" class="nav-link">JS</a></div><div class="nav-item"><a href="/blog/vuepress/css/" class="nav-link router-link-active">CSS</a></div><div class="nav-item"><a href="/blog/vuepress/html/" class="nav-link">HTML</a></div><div class="nav-item"><a href="/blog/vuepress/else/" class="nav-link">其他</a></div><div class="nav-item"><a href="/blog/vuepress/study/" class="nav-link">study</a></div><a href="https://github.com/xiaotianxia" target="_blank" rel="noopener noreferrer" class="repo-link">
    GitHub
    <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></nav></div></header><div class="sidebar-mask"></div><div class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="/blog/vuepress/js/" class="nav-link">JS</a></div><div class="nav-item"><a href="/blog/vuepress/css/" class="nav-link router-link-active">CSS</a></div><div class="nav-item"><a href="/blog/vuepress/html/" class="nav-link">HTML</a></div><div class="nav-item"><a href="/blog/vuepress/else/" class="nav-link">其他</a></div><div class="nav-item"><a href="/blog/vuepress/study/" class="nav-link">study</a></div><a href="https://github.com/xiaotianxia" target="_blank" rel="noopener noreferrer" class="repo-link">
    GitHub
    <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></nav><ul class="sidebar-links"><li><div class="sidebar-group first"><p class="sidebar-heading open"><span>CSS</span><!----></p><ul class="sidebar-group-items"><li><a href="/blog/vuepress/css/" class="sidebar-link">目录</a></li><li><a href="/blog/vuepress/css/svg_path_animation.html" class="sidebar-link">SVG轻松实现路径动画</a></li><li><a href="/blog/vuepress/css/clip_path.html" class="sidebar-link">CSS中的图像处理 —— clip-path</a></li><li><a href="/blog/vuepress/css/columns.html" class="active sidebar-link">Columns —— CSS多栏布局</a></li><li><a href="/blog/vuepress/css/grid_layout.html" class="sidebar-link">Grid —— CSS网格布局初探</a></li><li><a href="/blog/vuepress/css/styled_switch.html" class="sidebar-link">radio和checkbox的自定义样式</a></li><li><a href="/blog/vuepress/css/use_of_checkbox.html" class="sidebar-link">checkbox的应用</a></li></ul></div></li></ul></div><div class="page"><div class="content"><h1 id="columns-——-css多栏布局"><a href="#columns-——-css多栏布局" aria-hidden="true" class="header-anchor">#</a> Columns —— CSS多栏布局</h1><p><a href="https://denzel.netlify.com/css/columns.html?_=7654323456782357" target="_blank" rel="noopener noreferrer">原文链接</a></p><h2 id="前言"><a href="#前言" aria-hidden="true" class="header-anchor">#</a> 前言</h2><p>人们阅读文本时，如果眼睛从一行的终点移动到下一个行的开始需要太长时间，它们就会丢失它们所在的行。
因此，为了最大限度地利用大屏幕，如果可以将文本分成多块列并排放置，就像报纸一样，想必会方便很多。
而CSS3里的多栏(multi-col)布局，就是为此而生了。</p><p>若文章页混乱，请移步原文地址：<a href="https://denzel.netlify.com/css/columns.html?_=7654323456782357" target="_blank" rel="noopener noreferrer">原文链接</a></p><p>这个属性相当简单，今天跟大家一起学习一下。</p><h2 id="正文"><a href="#正文" aria-hidden="true" class="header-anchor">#</a> 正文</h2><h3 id="columns声明多栏布局"><a href="#columns声明多栏布局" aria-hidden="true" class="header-anchor">#</a> columns声明多栏布局</h3><pre class="language-css"><code><span class="token property">columns</span><span class="token punctuation">:</span> column-width | column-count<span class="token punctuation">;</span>
</code></pre><h3 id="column-gap、column-rule样式控制"><a href="#column-gap、column-rule样式控制" aria-hidden="true" class="header-anchor">#</a> column-gap、column-rule样式控制</h3><pre class="language-css"><code>column-gap <span class="token comment">/*栏之间的间隔*/</span>
column-rule <span class="token comment">/*分割线 与border的写法几乎一毛一样*/</span>
<span class="token comment">/*column-rule分开写是这样的：*/</span>
column-rule-width <span class="token comment">/*分割线宽*/</span>
column-rule-style <span class="token comment">/*分割线样式*/</span>
column-rule-color <span class="token comment">/*分割线颜色*/</span>
</code></pre><p>一个相对完整的多栏布局结构是这样的：
<img src="http://pn4meizzc.bkt.clouddn.com/columns.svg" alt="demo"></p><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>多栏容器中的其他元素，样式中的百分比是相对其所在的某一栏的。
见下例中的图片，宽度是100%。</p></div><h3 id="column-span"><a href="#column-span" aria-hidden="true" class="header-anchor">#</a> column-span</h3><p>如果想让某元素在多栏容器中占据整行(横穿所有栏)，需要用到column-span。该属性只有两个值：'all'、'none'。
详见下例。</p><p>但是这个属性目前pc端的Firefox还没支持，奇怪的是移动端的Firefox竟然支持😄 。</p><p>下面是浏览器计算column-count、column-width和容器可用宽度的伪代码：</p><pre class="language-js"><code><span class="token keyword">let</span> <span class="token constant">N</span><span class="token punctuation">,</span> <span class="token comment">//column-count</span>
    <span class="token constant">W</span><span class="token punctuation">,</span> <span class="token comment">//column-width </span>
    <span class="token constant">W</span><span class="token punctuation">;</span> <span class="token comment">//容器的可用宽度</span>
<span class="token keyword">if</span> <span class="token punctuation">(</span><span class="token punctuation">(</span>column<span class="token operator">-</span>width <span class="token operator">==</span> auto<span class="token punctuation">)</span> <span class="token operator">&amp;&amp;</span> <span class="token punctuation">(</span>column<span class="token operator">-</span>count <span class="token operator">==</span> auto<span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
    <span class="token keyword">return</span><span class="token punctuation">;</span> <span class="token comment">/* 不是多栏容器 */</span>
<span class="token punctuation">}</span>
<span class="token keyword">if</span> <span class="token punctuation">(</span>column<span class="token operator">-</span>width <span class="token operator">==</span> auto<span class="token punctuation">)</span> <span class="token punctuation">{</span>
    <span class="token constant">N</span> <span class="token operator">=</span> column<span class="token operator">-</span>count<span class="token punctuation">;</span>
<span class="token punctuation">}</span> <span class="token keyword">else</span> <span class="token keyword">if</span> <span class="token punctuation">(</span>column<span class="token operator">-</span>count <span class="token operator">==</span> auto<span class="token punctuation">)</span> <span class="token punctuation">{</span>
    <span class="token constant">N</span> <span class="token operator">=</span> <span class="token function">max</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">,</span> <span class="token function">floor</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token constant">U</span> <span class="token operator">+</span> column<span class="token operator">-</span>gap<span class="token punctuation">)</span> <span class="token operator">/</span> <span class="token punctuation">(</span>column<span class="token operator">-</span>width <span class="token operator">+</span> column<span class="token operator">-</span>gap<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span> <span class="token keyword">else</span> <span class="token punctuation">{</span>
    <span class="token constant">N</span> <span class="token operator">=</span> <span class="token function">min</span><span class="token punctuation">(</span>column<span class="token operator">-</span>count<span class="token punctuation">,</span> <span class="token function">max</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">,</span> <span class="token function">floor</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token constant">U</span> <span class="token operator">+</span> column<span class="token operator">-</span>gap<span class="token punctuation">)</span> <span class="token operator">/</span> <span class="token punctuation">(</span>column<span class="token operator">-</span>width <span class="token operator">+</span> column<span class="token operator">-</span>gap<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>

<span class="token constant">W</span> <span class="token operator">=</span> <span class="token function">max</span><span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">,</span> <span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token constant">U</span> <span class="token operator">+</span> column<span class="token operator">-</span>gap<span class="token punctuation">)</span> <span class="token operator">/</span> <span class="token constant">N</span> <span class="token operator">-</span> column<span class="token operator">-</span>gap<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre><h2 id="demo"><a href="#demo" aria-hidden="true" class="header-anchor">#</a> Demo:</h2><div class="columns-wrapper" data-v-00cb2524><div class="content-wrapper" data-v-00cb2524><div class="col-content" style="column-width:100px;column-count:3;column-gap:10px;column-rule-width:3px;column-rule-style:solid;column-rule-color:#000;" data-v-00cb2524>
			My father was a self-taught mandolin player. He was one of the best string instrument players in our town. He could not read music, but if he heard a tune a few times, he could play it. When he was younger, <!---->he was a member of a small country music band.
			They would play at local dances and on a few occasions would play for the local radio station. 
			<img src="https://denzel.netlify.com/hero.gif" alt data-v-00cb2524>
			He often told us how he had auditioned and earned a position in a band that featured Patsy Cline as their lead singer. He told the family that after he was hired he never went back. Dad was a very religious man. He stated that there was a lot of drinking and cursing the day of his audition and he did not want to be around that type of environment.
		</div><hr data-v-00cb2524><div class="col-content" style="column-width:100px;column-count:3;column-gap:10px;column-rule-width:3px;column-rule-style:solid;column-rule-color:#000;" data-v-00cb2524>
			我与父亲不相见已二年余了，我最不能忘记的是他的背影。那年冬天，祖母死了，父亲的差使也交卸了，正是祸不单行的日子，我从北京到徐州，打算跟着父亲奔丧回家。到徐州见着父亲，看见满院狼藉的东西，又想起祖母，不禁簌簌地流下眼泪。父亲说，“事已如此，不必难过，好在天无绝人之路！”
			<img src="https://denzel.netlify.com/hero.gif" alt data-v-00cb2524>
			回家变卖典质，父亲还了亏空；又借钱办了丧事。<!---->这些日子，家中光景很是惨淡，一半为了丧事，一半为了父亲赋闲。丧事完毕，父亲要到南京谋事，我也要回北京念书，我们便同行。
			到南京时，有朋友约去游逛，勾留了一日；第二日上午便须渡江到浦口，下午上车北去。父亲因为事忙，本已说定不送我，叫旅馆里一个熟识的茶房陪我同去。他再三嘱咐茶房，甚是仔细。但他终于不放心，怕茶房不妥帖；颇踌躇了一会。其实我那年已二十岁，北京已来往过两三次，是没有甚么要紧的了。他踌躇了一会，终于决定还是自己送我去。我两三回劝他不必去；他只说，“不要紧，他们去不好！”
		</div></div><hr data-v-00cb2524><div class="operate-wrapper" data-v-00cb2524><form class="el-form el-form--label-left" data-v-00cb2524><div class="el-form-item" data-v-00cb2524><label class="el-form-item__label" style="width:180px;">column-width(px):</label><div class="el-form-item__content" style="margin-left:180px;"><div role="slider" aria-valuemin="0" aria-valuemax="400" aria-orientation="horizontal" class="el-slider el-slider--with-input" data-v-00cb2524><div debounce="300" class="el-slider__input el-input-number el-input-number--small"><span role="button" class="el-input-number__decrease"><i class="el-icon-minus"></i></span><span role="button" class="el-input-number__increase"><i class="el-icon-plus"></i></span><div class="el-input el-input--small"><!----><input type="text" autocomplete="off" max="400" min="0" value="0" class="el-input__inner"><!----><!----><!----></div></div><div class="el-slider__runway show-input"><div class="el-slider__bar" style="width:0%;left:0%;"></div><div tabindex="0" class="el-slider__button-wrapper" style="left:0%;"><div class="el-slider__button el-tooltip"></div></div><!----></div></div><!----></div></div><div class="el-form-item" data-v-00cb2524><label class="el-form-item__label" style="width:180px;">column-count:</label><div class="el-form-item__content" style="margin-left:180px;"><div role="slider" aria-valuemin="0" aria-valuemax="10" aria-orientation="horizontal" class="el-slider el-slider--with-input" data-v-00cb2524><div debounce="300" class="el-slider__input el-input-number el-input-number--small"><span role="button" class="el-input-number__decrease"><i class="el-icon-minus"></i></span><span role="button" class="el-input-number__increase"><i class="el-icon-plus"></i></span><div class="el-input el-input--small"><!----><input type="text" autocomplete="off" max="10" min="0" value="0" class="el-input__inner"><!----><!----><!----></div></div><div class="el-slider__runway show-input"><div class="el-slider__bar" style="width:0%;left:0%;"></div><div tabindex="0" class="el-slider__button-wrapper" style="left:0%;"><div class="el-slider__button el-tooltip"></div></div><!----></div></div><!----></div></div><div class="el-form-item" data-v-00cb2524><label class="el-form-item__label" style="width:180px;">column-gap(px):</label><div class="el-form-item__content" style="margin-left:180px;"><div role="slider" aria-valuemin="0" aria-valuemax="30" aria-orientation="horizontal" class="el-slider el-slider--with-input" data-v-00cb2524><div debounce="300" class="el-slider__input el-input-number el-input-number--small"><span role="button" class="el-input-number__decrease"><i class="el-icon-minus"></i></span><span role="button" class="el-input-number__increase"><i class="el-icon-plus"></i></span><div class="el-input el-input--small"><!----><input type="text" autocomplete="off" max="30" min="0" value="0" class="el-input__inner"><!----><!----><!----></div></div><div class="el-slider__runway show-input"><div class="el-slider__bar" style="width:0%;left:0%;"></div><div tabindex="0" class="el-slider__button-wrapper" style="left:0%;"><div class="el-slider__button el-tooltip"></div></div><!----></div></div><!----></div></div><div class="el-form-item" data-v-00cb2524><label class="el-form-item__label" style="width:180px;">column-rule-width(px):</label><div class="el-form-item__content" style="margin-left:180px;"><div role="slider" aria-valuemin="0" aria-valuemax="30" aria-orientation="horizontal" class="el-slider el-slider--with-input" data-v-00cb2524><div debounce="300" class="el-slider__input el-input-number el-input-number--small"><span role="button" class="el-input-number__decrease"><i class="el-icon-minus"></i></span><span role="button" class="el-input-number__increase"><i class="el-icon-plus"></i></span><div class="el-input el-input--small"><!----><input type="text" autocomplete="off" max="30" min="0" value="0" class="el-input__inner"><!----><!----><!----></div></div><div class="el-slider__runway show-input"><div class="el-slider__bar" style="width:0%;left:0%;"></div><div tabindex="0" class="el-slider__button-wrapper" style="left:0%;"><div class="el-slider__button el-tooltip"></div></div><!----></div></div><!----></div></div><div class="el-form-item" data-v-00cb2524><label class="el-form-item__label" style="width:180px;">column-rule-style:</label><div class="el-form-item__content" style="margin-left:180px;"><div class="el-select" data-v-00cb2524><!----><div class="el-input el-input--suffix"><!----><input type="text" autocomplete="off" placeholder="请选择" readonly="readonly" value="" class="el-input__inner"><!----><span class="el-input__suffix"><span class="el-input__suffix-inner"><i class="el-select__caret el-input__icon el-icon-arrow-up"></i><!----></span><!----></span><!----></div><div class="el-select-dropdown el-popper" style="min-width:;display:none;"><div class="el-scrollbar" style="display:none;"><div class="el-select-dropdown__wrap el-scrollbar__wrap el-scrollbar__wrap--hidden-default"><ul class="el-scrollbar__view el-select-dropdown__list"><!----><li class="el-select-dropdown__item selected" data-v-00cb2524><span>solid</span></li><li class="el-select-dropdown__item" data-v-00cb2524><span>dotted</span></li><li class="el-select-dropdown__item" data-v-00cb2524><span>dashed</span></li><li class="el-select-dropdown__item" data-v-00cb2524><span>double</span></li><li class="el-select-dropdown__item" data-v-00cb2524><span>groove</span></li></ul></div><div class="el-scrollbar__bar is-horizontal"><div class="el-scrollbar__thumb" style="width:0;transform:translateX(0%);ms-transform:translateX(0%);webkit-transform:translateX(0%);"></div></div><div class="el-scrollbar__bar is-vertical"><div class="el-scrollbar__thumb" style="height:0;transform:translateY(0%);ms-transform:translateY(0%);webkit-transform:translateY(0%);"></div></div></div><p class="el-select-dropdown__empty">
        无数据
      </p></div></div><!----></div></div><div class="el-form-item" data-v-00cb2524><label class="el-form-item__label" style="width:180px;">column-rule-color:</label><div class="el-form-item__content" style="margin-left:180px;"><div class="el-color-picker" data-v-00cb2524><!----><div class="el-color-picker__trigger"><span class="el-color-picker__color is-alpha"><span class="el-color-picker__color-inner" style="background-color:rgba(255, 0, 0, 1);"></span><!----></span><span class="el-color-picker__icon el-icon-arrow-down"></span></div><div class="el-color-dropdown el-color-picker__panel" style="display:none;"><div class="el-color-dropdown__main-wrapper"><div class="el-color-hue-slider is-vertical" style="float:right;"><div class="el-color-hue-slider__bar"></div><div class="el-color-hue-slider__thumb" style="left:0px;top:0px;"></div></div><div class="el-color-svpanel" style="background-color:hsl(0, 100%, 50%);"><div class="el-color-svpanel__white"></div><div class="el-color-svpanel__black"></div><div class="el-color-svpanel__cursor" style="top:0px;left:0px;"><div></div></div></div></div><div class="el-color-alpha-slider"><div class="el-color-alpha-slider__bar" style="background:null;"></div><div class="el-color-alpha-slider__thumb" style="left:0px;top:0px;"></div></div><!----><div class="el-color-dropdown__btns"><span class="el-color-dropdown__value"><div class="el-input el-input--mini"><!----><input type="text" autocomplete="off" value="" class="el-input__inner"><!----><!----><!----></div></span><button type="button" class="el-button el-color-dropdown__link-btn el-button--text el-button--mini"><!----><!----><span>
        清空
      </span></button><button type="button" class="el-button el-color-dropdown__btn el-button--default el-button--mini is-plain"><!----><!----><span>
        确定
      </span></button></div></div></div><!----></div></div><div class="el-form-item" data-v-00cb2524><label class="el-form-item__label" style="width:180px;">column-rule:</label><div class="el-form-item__content" style="margin-left:180px;"><span data-v-00cb2524>3px solid #000</span><!----></div></div><div class="el-form-item" data-v-00cb2524><label class="el-form-item__label" style="width:180px;">column-rule-color:</label><div class="el-form-item__content" style="margin-left:180px;"><label role="checkbox" class="el-checkbox" data-v-00cb2524><span aria-checked="mixed" class="el-checkbox__input"><span class="el-checkbox__inner"></span><input type="checkbox" aria-hidden="true" class="el-checkbox__original"></span><span class="el-checkbox__label">添加一个div<!----></span></label><!----></div></div><!----></form><pre class="language-css" data-v-00cb2524>			.content {
  &quot;column-width&quot;: &quot;100px&quot;,
  &quot;column-count&quot;: 3,
  &quot;column-gap&quot;: &quot;10px&quot;,
  &quot;column-rule-width&quot;: &quot;3px&quot;,
  &quot;column-rule-style&quot;: &quot;solid&quot;,
  &quot;column-rule-color&quot;: &quot;#000&quot;
}

			.span {
  &quot;column-span&quot;: &quot;all&quot;
}
		</pre></div></div><h2 id="参考资料"><a href="#参考资料" aria-hidden="true" class="header-anchor">#</a> 参考资料</h2><ul><li><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/columns" target="_blank" rel="noopener noreferrer">columns</a></li><li><a href="https://drafts.csswg.org/css-multicol-1/" target="_blank" rel="noopener noreferrer">CSS Multi-column Layout Module Level 1</a></li><li><a href="https://drafts.csswg.org/css-multicol-2/" target="_blank" rel="noopener noreferrer">CSS Multi-column Layout Module Level 2</a></li></ul></div><div class="wx-wrapper" data-v-0de8a4bf><p class="wx-txt" data-v-0de8a4bf>欢迎关注</p><img src="http://pn4meizzc.bkt.clouddn.com/wxqr.png" class="wx-img" data-v-0de8a4bf></div><div class="beg-wrapper" data-v-1f1af99c><a href="javascript:;" class="btn show" data-v-1f1af99c><img src="http://pn4meizzc.bkt.clouddn.com/blogshang_log.png" data-v-1f1af99c></a><p class="shang-txt" data-v-1f1af99c>赏不赏，看您心情</p><img src="http://pn4meizzc.bkt.clouddn.com/blogWechatIMG35.jpeg" class="shangImg" data-v-1f1af99c></div><!----><div class="content page-nav"><p class="inner"><span class="prev">
        ← <a href="/blog/vuepress/css/clip_path.html" class="prev">
          CSS中的图像处理 —— clip-path
        </a></span><span class="next"><a href="/blog/vuepress/css/grid_layout.html">
          Grid —— CSS网格布局初探
        </a> →
      </span></p></div></div></div></div>
    <script src="/blog/vuepress/assets/js/51.766a8294.js" defer></script><script src="/blog/vuepress/assets/js/80.4ca072f1.js" defer></script><script src="/blog/vuepress/assets/js/app.15770e34.js" defer></script>
  </body>
</html>
